#pragma once
#include<iostream>
#include<cmath>
#include<vector>
#include<random>

typedef float LD;

template<typename Te>
class Matrix {
public:
	Matrix();
	Matrix(std::vector<std::vector<Te>> init);
	Matrix(std::vector<Te> init);
	size_t Shape_row();
	size_t Shape_col();
	Te operator()(size_t row, size_t col);
	Matrix& T_f();
	Matrix& dot(Matrix& right, Matrix* result = nullptr);
	Matrix& operator*(Te num);
	Matrix& operator+(Te num);
	Te* for_each(bool refresh = 0);
	std::vector<Te>* each_line(bool refresh = 0);
};

LD getrandom();
LD sigmoid(LD x);
LD sigmoidDelta(LD x);
LD calLoss(std::vector<LD>& pridic, std::vector<LD>& actual);
